<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<style>
.error {font-weight: bold;
color:#760000;
</style>
</head>
<body>

<fieldset><legend accesskey="L" tabindex="1">Login</legend>

<?=(isset($this->validation) ? $this->validation->error_string : '')?>

<?=form_open('auth/login')?>
	<p><span><label for="alias">Alias: </label>
	
	<input type="text" name="alias" value="<?=(isset($this->validation) ? $this->validation->{'alias'} : '')?>" size="10" />
	</span></p>

	<p><label for="password">Password: </label>
	<input type="password" name="password" value="" size="10" />

<?php	
	$this->load->plugin('captcha');
	$vals = array(
					'img_path'	 => '/var/www/public/captcha/',
					'img_url'	 => 'http://localhost/public/captcha/',
					'font_path'	 => '/var/www/system/fonts/jester.ttf',
					'img_width'	 => 150,
					'img_height' => 30,
					'expiration' => 360
				);
	
	$cap = create_captcha($vals);

	$data = array(
					'captcha_id'	=> '',
					'captcha_time'	=> $cap['time'],
					'ip_address'	=> $this->input->ip_address(),
					'word'			=> $cap['word']
				);

	$query = $this->db->insert_string('captcha', $data);
	$this->db->query($query);
		
	echo '<br />Submit the word you see below:<br />';
	echo $cap['image'];
	echo '<br /><input type="text" name="captcha" value="" />';
	
?>
	<div><input type="submit" name="login" value="Submit" /></div>

</form>
</fieldset>

</body>
</html>
